var a = [1, 3, 5, 5, 6, [5, 6, 9, [5, 6]]]
    (function(now) {
        let arr = now.flat(Infinity)
        console.log(arr);
    })(a)

var a = [1, 3, 5, 5, 6, [5, 6, 9, [5, 6]]]
let arr = a.flat(Infinity)
console.log(arr);